package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/** @author JoeZhou */
@Schema(name = "创建预支付订单DTO")
@Data
public class PrePayDTO implements Serializable, RE {

	@NotNull(message = "用户ID不能为空")
	@Schema(description = "用户ID：购买人的ID")
	private Long fkUserId;

	@NotNull(message = "课程主键列表不能为空")
	@Size(min = 1, message = "课程主键列表至少包含一个元素")
	@Schema(description = "课程主键列表")
	private List<Long> courseIds;

	@NotNull(message = "订单总金额不能为空")
	@DecimalMin(value = "0", message = "订单总金额不能小于0元")
	@Schema(description = "订单总金额")
	private Double totalAmount;

	@NotNull(message = "订单实际支付总金额不能为空")
	@DecimalMin(value = "0", message = "订单实际支付总金额不能小于0元")
	@Schema(description = "订单实际支付总金额")
	private Double payAmount;

	@Schema(description = "优惠卷ID：下单时使用的优惠卷")
	private Long fkCouponsId;
}